package com.jia.leetCode;

public class Pro1518 {
    public int numWaterBottles(int numBottles, int numExchange) {
        int sum = numBottles;
        while(numBottles / numExchange != 0) {
            sum += numBottles / numExchange;
            numBottles = numBottles / numExchange +  numBottles % numExchange;
        }
        return sum;
    }
}
